package apiday01;

/**
 * boolean startsWith(String str)
 * 判断当前字符串是否是已给定的字符串开始的
 * boolean endsWith(String str)
 * 判断当前字符串是否是已给定的字符串结束的
 */
public class StartsWithDemo {
    public static void main(String[] args) {
        String str = "think in java";//think in java -java编程思想()
        boolean starts = str.startsWith("think");//判断str是否以think开头
        System.out.println(starts);
        boolean ends = str.endsWith(".png");//判断str是否以.pan结尾的
        System.out.println(ends);
    }
}
